package com.itany.corejava.day11;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.IOException;

public class TestJLabel {

    public static void main(String[] args) throws IOException {

        JFrame jf=new JFrame();

        jf.setLayout(new FlowLayout());


        JLabel jl1=new JLabel("abc");

        jf.add(jl1);




        Icon ic=new ImageIcon(ImageIO.read(TestJLabel.class
                                                     .getClassLoader()
                                                     .getResourceAsStream("com/itany/corejava/day11/a.jpg")));

        JLabel jl2=new JLabel(ic);

        jf.add(jl2);
















        jf.pack();
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);



    }


}
